<template>
  <div id="error">
    <div class="center">
      <div class="title">错误提示</div>
      <div class="text"> {{error}}</div>
      <div class="back">
        <button type="button" @click="back()">返回</button>
      </div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  export default {
    props: {
      error: {
        type: String,
        default: ''
      }
    },
    methods: {
      back() {
        this.$router.goBack()
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss">
  @import "~common/scss/const";

  #error {
    width: 100%;
    position: fixed;
    top: 45px;
    bottom: 0;
    .center {
      position: relative;
      top: 50%;
      margin: 0 auto;
      transform: translate3d(0, -50%, 0);
      width: 72%;
      border: 1px solid #999999;
      box-sizing: border-box;
      padding: 0 15px;
      background-color: #333333;
      display: flex;
      flex-direction: column;
      height: 150px;
      .title {
        width: 100%;
        height: 35px;
        line-height: 35px;
        flex: 0 0 35px;
        border-bottom: 1px solid #999999;
        text-align: center;
        font-size: $font-size-medium;
        color: #dddddd;
        font-weight: bold;
      }
      .text {
        width: 100%;
        flex: 1;
        overflow: hidden;
        text-align: center;
        font-size: $font-size-medium;
        color: #ffffff;
        box-sizing: border-box;
        padding: 10px;
      }
      .back {
        height: 50px;
        flex: 0 0 50px;
        padding: 10px 0;
        border-top: 1px solid #999999;
        box-sizing: border-box;
        button {
          display: inline-block;
          width: 100%;
          box-sizing: border-box;
          height: 30px;
          line-height: 25px;
          border: 1px solid #999999;
          margin: 0;
          background: #ffffff;
          color: #333333;
          cursor: pointer;
        }
      }
    }
  }
</style>
